/**
    给定x，求abc，满足
    a^3+b^3+c^3==x
    x在200以内，可以打表
*/
#include <bits/stdc++.h>
using namespace std;

int getUnsigned(){
	char ch = getchar();
	while( ch < '0' || ch > '9' ) ch = getchar();

	int ret = (int)(ch-'0');
	while( '0' <= ( ch = getchar() ) && ch <= '9' ) ret = ret * 10 + (int)(ch-'0');
	return ret;
}

int A[210][3]={
0,0,0,
0,0,1,
0,1,1,
1,1,1,
-5001,0,0,
-5001,0,0,
-1,-1,2,
0,-1,2,
0,0,2,
0,1,2,
1,1,2,
297,-641,619,
7,-11,10,
-5001,0,0,
-5001,0,0,
2,-1,2,
0,2,2,
1,2,2,
75,-218,215,
0,-2,3,
1,-2,3,
28,-86,85,
-5001,0,0,
-5001,0,0,
2,2,2,
1839,-2683,2357,
0,-1,3,
0,0,3,
0,1,3,
1,1,3,
-5001,0,0,
-5001,0,0,
-5001,0,0,
-5001,0,0,
2,-1,3,
0,2,3,
1,2,3,
0,-3,4,
1,-3,4,
-5001,0,0,
-5001,0,0,
-5001,0,0,
-5001,0,0,
2,2,3,
-5,-7,8,
2,-3,4,
3,-2,3,
6,-8,7,
-2,-2,4,
-5001,0,0,
-5001,0,0,
602,-796,659,
-5001,0,0,
3,-1,3,
0,3,3,
1,3,3,
0,-2,4,
1,-2,4,
-5001,0,0,
-5001,0,0,
-1,-4,5,
0,-4,5,
2,3,3,
0,-1,4,
0,0,4,
0,1,4,
1,1,4,
-5001,0,0,
-5001,0,0,
2,-4,5,
11,-21,20,
2,-1,4,
0,2,4,
1,2,4,
-5001,0,0,
-5001,0,0,
-5001,0,0,
-5001,0,0,
26,-55,53,
-19,-33,35,
2,2,4,
3,3,3,
847,-1317,1188,
3,-2,4,
-5001,0,0,
-5001,0,0,
-5001,0,0,
-1972,-4126,4271,
3,-4,5,
6,-7,6,
3,-1,4,
0,3,4,
1,3,4,
-5,-5,7,
-5001,0,0,
-5001,0,0,
14,-22,20,
17,-22,18,
0,-3,5,
2,3,4,
-3,-6,7,
4,-3,4,
118,-239,229,
-5001,0,0,
-5001,0,0,
-4,-7,8,
2,-3,5,
947,-1309,1117,
-948,-1165,1345,
146,-1019,1018,
-5001,0,0,
148,-1040,1039,
-5001,0,0,
-5001,0,0,
-5001,0,0,
8,-12,11,
-1,-2,5,
0,-2,5,
3,3,4,
-2,-6,7,
4,-2,4,
-5001,0,0,
-5001,0,0,
-1,-1,5,
0,-1,5,
0,0,5,
0,1,5,
1,1,5,
0,4,4,
1,4,4,
-5001,0,0,
-5001,0,0,
2,-1,5,
0,2,5,
1,2,5,
2,-6,7,
2,4,4,
-9,-11,13,
-77,-86,103,
-5001,0,0,
-5001,0,0,
2,2,5,
-3,-7,8,
-5001,0,0,
3,-2,5,
-7,-8,10,
108,-149,127,
1528,-2366,2131,
-5001,0,0,
-5001,0,0,
260,-367,317,
3,-1,5,
0,3,5,
1,3,5,
3,-6,7,
3,4,4,
-5001,0,0,
-5001,0,0,
-5001,0,0,
80,-130,119,
2,3,5,
20,-31,28,
4,-3,5,
226,-1134,1131,
-45,-47,58,
-5001,0,0,
-5001,0,0,
-5001,0,0,
56,-172,170,
0,-7,8,
1,-7,8,
67,-87,71,
-5001,0,0,
-5001,0,0,
7,-8,7,
-5001,0,0,
-5001,0,0,
2,-7,8,
-10,-13,15,
3,3,5,
-5001,0,0,
4,-2,5,
9,-14,13,
10,-17,16,
-5001,0,0,
-5001,0,0,
5,-4,5,
27,-58,56,
4,-1,5,
0,4,5,
1,4,5,
4,-6,7,
4,4,4,
-5001,0,0,
-5001,0,0,
-5001,0,0,
3,-7,8,
2,4,5,
148,-195,161,
15,-24,22,
73,-114,103};

int main(){
    //freopen("1.txt","r",stdin);
    int nofkase = getUnsigned();
    while(nofkase--){
        int n = getUnsigned();
        if(A[n][0]!=-5001){
            printf("%d %d %d\n",A[n][0],A[n][1],A[n][2]);
        }else{
            printf("impossible\n");
        }
    }
    return 0;
}
